//
//  QChargeBookDB.h
//  QoilPublic
//
//  Created by 杨凯 on 16/8/22.
//  Copyright © 2016年 杨凯. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface QChargeBookDB : NSObject

//插入数据 accountId text,userName text,monthidstr text,createTime text,dict blob
+ (BOOL)saveChargeBookDataWithaccountId:(NSString *)accountId monthidStr:(NSString *)monthidStr createTime:(NSString *)createTime dataDic:(NSDictionary *)dataDic;

//插入更新的数据
+ (void)saveChargeBookUpdateAllData:(NSArray *)array successBlock:(void(^)())block;

//查询数据
+ (NSArray *)queryChargeBookData;

//修改数据
+ (BOOL)updateSetDataWithaccountId:(NSString *)accountId dataDic:(NSDictionary *)dataDic monthidStr:(NSString *)monthidStr createTime:(NSString *)createTime;

//删除某一条数据
+ (BOOL)deleteChargeBookDataWithaccountId:(NSString *)accountId;

//删除对应的月数据
+ (void)deleteChargeBookDataWithYearMonth:(NSString *)yearMonth successsBlock:(void(^)())block;

//记账本主页三条数据
+ (NSArray *)queryMainPageData:(NSString *)monthidStr;

//记账本主页一个月的数据
+ (NSArray *)queryMainPageWithMonthData:(NSString *)monthidStr;

//设置数据
+ (NSMutableArray *)setupChargeBookData:(NSArray *)arr;

////配置文件路径
+ (NSString *)fileCreate:(NSString *)path;

//写配置文件数据
+ (void)writeFileByArray:(NSString *)filePath arrData:(NSMutableArray *)arrData successBlock:(void(^)())block;

//读配置文件
+ (NSMutableArray *)readDataArrToFilePath:(NSString *)filePath;

//提交配置文件给服务器
+ (NSData *)submitProfileDataToSever:(NSString *)filePath;

//公用的写配置文件回调
+ (void)writeProfileByYearMonth:(NSString *)yearMonth time:(NSString *)time successBlock:(void(^)(NSString *arrf))block;

//当前的周几
+ (NSString *)currentWeek;

//初始化年月日时间
+ (void)formatDate:(NSString *)str successBlock:(void(^)(NSString *y,NSString *m,NSString *d,NSString *t))block;


@end
